﻿@inherits EntitesGridModel<Entity.UserConsent>

<EntitiesGrid Items="@Consents" TableClass="table table-hover" Context="consent">
    <TableHeader>
        <th scope="col">
            <SortableHeader Property="ClientId"
                            Text="@Localizer["client id"]"
                            GridState="GridState" />
        </th>
        <th scope="col">
            scopes
        </th>
        <th>
            <SortableHeader Property="CreateAt"
                            Text="@Localizer["create at"]"
                            GridState="GridState" />
        </th>
        <th></th>
    </TableHeader>
    <RowTemplate>
        <td>
            @consent.ClientId
        </td>
        <td>
            <ul class="list-inline">
                @foreach (var scope in GetScopes(consent))
                {
                    <li class="list-inline-item">@scope</li>
                }
            </ul>
        </td>
        <td>
            @consent.CreatedAt.ToShortDateString() @consent.CreatedAt.ToShortTimeString()
        </td>
        <td>
            <AuthorizeButton Type="button" CssSubClass="btn-primary" Clicked="() => OnDeleteEntityClicked(consent)">
                <span class="oi oi-trash"></span>
            </AuthorizeButton>
        </td>
    </RowTemplate>
</EntitiesGrid>
